package com.caigou.service.impl;

import com.caigou.bean.cms.entity.OperationLog;
import com.caigou.bean.cms.entity.Picture;
import com.caigou.bean.cms.param.OperationLogParam;
import com.caigou.bean.exam.entity.Users;
import com.caigou.mapper.cms.OperationLogMapper;
import com.caigou.service.OperationLogService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@Service("operationLogService")
public class OperationServiceImpl implements OperationLogService {

    @Resource
    private OperationLogMapper operationLogMapper;


    public OperationLog selectByPrimaryKey(int id){
        return operationLogMapper.selectByPrimaryKey(id);
    }

    public int insertSelective(OperationLog operationLog){
        return operationLogMapper.insertSelective(operationLog);
    }

    public PageInfo<OperationLog> queryOperationLog(OperationLogParam operationLogParam){
        Page<?> page = PageHelper.startPage(operationLogParam.getPageNum(), operationLogParam.getPageSize());
        List<OperationLog> operationLogList = operationLogMapper.queryOperationLog(operationLogParam);
        PageInfo<OperationLog> operationLogPageInfo = new PageInfo<>(operationLogList);
        return operationLogPageInfo;
    }
}
